package com.swadar.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.swadar.beans.valueobject.ProductVO;
import com.swadar.beans.valueobject.RecProductVO;
import com.swadar.helper.ProductPageHelper;


@Controller
public class ProductPageController {
	
	@Autowired
	private ProductPageHelper homeHelper;
	
	@RequestMapping("/product.do")
	public String getProduct(ModelMap map,@RequestParam("id") Integer id){
		ProductVO productVO = homeHelper.getProduct(id);
		List<RecProductVO> productVOList = homeHelper.getRecProduct(id);
		map.put("productVOList", productVOList);
		map.put("productVO", productVO);
		return "product";
	}
	
}
